// match:根据正则匹配搜索对应的字符，并返回字符数组
let s = "The rain in SPAiN stays mainly in the plain";
let reg = /ain/gi; // 查找ain;i:不区分大小写
let res = s.match(reg);
console.log(res); // [ 'ain', 'AiN', 'ain', 'ain' ]
